package main.java.chessfootball.model.play;

import main.java.chessfootball.model.game.Cell;

/**
 * User: Igor
 * Date: 10.06.2011
 * Time: 22:29:31
 */
public enum Vector
{
	UP(0, 0, -1),
	UP_RIGHT(1, 1, -1),
	RIGHT(2, 1, 0),
	DOWN_RIGHT(3, 1, 1),
	DOWN(4, 0, 1),
	DOWN_LEFT(5, -1, 1),
	LEFT(6, -1, 0),
	UP_LEFT(7, -1, -1);

	private int id;
	private int x;
	private int y;

	Vector(int id, int x, int y)
	{
		this.id = id;
		this.x = x;
		this.y = y;
	}

	public int getX()
	{
		return x;
	}

	public int getY()
	{
		return y;
	}

	public int getId()
	{
		return id;
	}

	public Cell getCell(Cell from, int length)
	{
		return new Cell(from.getX() + getX() * length, from.getY() + getY() * length);
	}
}
